<?php
class AdminKqLotoMiennam extends CActiveRecord{
    
    public static function model($className = __CLASS__) {
        return parent::model ( $className );
    }
    
    // dat luat cho model
    public function rules(){}         

    // goi den bang can ket noi   
    public function tableName() {                  
        return 'thongke_loto_miennam';
    }

    // nhan cac thuong tinh 
    public function attributeLabels(){}
    
    public function getRowByKetqua($ketqua_id)
    {
        $ketqua_id = intval($ketqua_id);
        $rows = array();       
        $sql = "SELECT id,ketqua_id,boso,is_dacbiet FROM thongke_loto_miennam WHERE ketqua_id=".$ketqua_id." ORDER BY boso ASC";           
        $connect = Yii::app()->db;
        $command = $connect->createCommand($sql);
        $rows = $command->queryAll();       
        return $rows;
    }
    
}
